package com.maxie.factory;

import com.maxie.state.State;
import com.maxie.state.impl.ChangeState;
import com.maxie.state.impl.CommonState;

/**
 * State工厂，因为，在servicezone中，需要获取状态，所以，在factory中，创建状态对象
 */
public class StateFactory {
    public static State getState(String stateStr) {
        if (null == stateStr || "".equals(stateStr)) {
            return new CommonState();
        }
        if(stateStr.equals("change")) {
            return new ChangeState();
        }
        return new CommonState();
    }
}
